<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    <style>
        /* 以下实例在页面创建一个计数器，在每一个 <h1> 元素前添加计数值 "Section <主标题计数值>.", 
            嵌套的计数值则放在 <h2> 元素的前面，内容为 "<主标题计数值>.<副标题计数值>": */
        body {
            counter-reset: section;
        }

        h1 {
            counter-reset: subsection;
        }

        h1::before {
            counter-increment: section;
            content: "Section " counter(section) ". ";
        }

        h2::before {
            counter-increment: subsection;
            content: counter(section) "." counter(subsection) " ";
        }
    </style>
</head>

<body>


    <h1>HTML 教程:</h1>
    <h2>HTML 教程</h2>
    <h2>CSS 教程</h2>

    <h1>Scripting 教程:</h1>
    <h2>JavaScript</h2>
    <h2>VBScript</h2>

    <h1>XML 教程:</h1>
    <h2>XML</h2>
    <h2>XSL</h2>

    <p><b>注意:</b> IE8 需要指定 !DOCTYPE 才可以支持该属性。</p>

</body>

</html>